# from .views import index
from django.urls import path, include
from apps.HttpTestcase.views import *
from django.conf.urls import url
from rest_framework import routers
# from rest_framework_jwt.views import obtain_jwt_token

# 创建路由对象
# router = routers.SimpleRouter()
router = routers.DefaultRouter()
# 注册路由
# 1.路由前缀 2.视图集
router.register(r'HttpTestcase/projects/list', ProjectsListViewSet, basename='HttpTestcase')
router.register(r'HttpTestcase/projects', ProjectsViewSet, basename='HttpTestcase')

router.register(r'HttpTestcase/envs', EnvsViewSet, basename='HttpTestcase')

router.register(r'HttpTestcase/interfaces/list', APIListViewSet, basename='HttpTestcase')
router.register(r'HttpTestcase/interfaces', ApiViewSet, basename='HttpTestcase')

router.register(r'HttpTestcase/module/list', ModularListViewSet, basename='HttpTestcase')
router.register(r'HttpTestcase/module', ModularViewSet, basename='HttpTestcase')

router.register(r'HttpTestcase/testcase_reports', ReportViewSet, basename='HttpTestcase')

router.register(r'HttpTestcase/testcases/list', TestcaseListViewSet, basename='HttpTestcase')
router.register(r'HttpTestcase/testcases', TestcasesViewSet, basename='HttpTestcase')

router.register(r'HttpTestcase/testsuite/list', TestsuiteList, basename='HttpTestcase')
router.register(r'HttpTestcase/testsuite/names', TestsuiteNames, basename='HttpTestcase')
router.register(r'HttpTestcase/testsuite', TestsuiteViewSet, basename='HttpTestcase')

router.register(r'HttpTestcase/testsuite2testcase', Testsuite2TestcaseViewSet, basename='HttpTestcase')
router.register(r'HttpTestcase/testsuite_reports', TestsuiteReportsViewSet, basename='HttpTestcase')
router.register(r'HttpTestcase/testsuite_names', TestsuiteNames, basename='HttpTestcase')

urlpatterns = [
    url(r'HttpTestcase/reports_details/', TestcaseReportsDetails.as_view()),
    url(r'HttpTestcase/reportssuite_details/', TestsuiteReportsAPIView.as_view()),
    url(r'HttpTestcase/testcases/batch/', TestcaseBatchAPIView.as_view()),
    url(r'HttpTestcase/testsuite/batch/', TestsuiteBatchAPIView.as_view()),
    url(r'HttpTestcase/testcases/debug/', TestcaseDebugAPIView.as_view()),
    url(r'HttpTestcase/testcase_reports/batch_delete/', TestReportsDelete.as_view()),
    url(r'HttpTestcase/tessuite_reports/batch_delete/', TestsuiteReportsDelete.as_view()),
    url(r'HttpTestcase/suite_case_reportse/', TestsuiteTestcaseReportsViewSet.as_view()),
    url(r'HttpTestcase/testcases/batch_delete/', TestcasesBatchDelete.as_view()),
    url(r'HttpTestcase/testsuite/batch_delete/', TestsuiteDelete.as_view()),
    # path('login/', obtain_jwt_token),
    # path('info/', get_user_info)
]
urlpatterns += router.urls
